import React from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import Home from './pages/Home';
import Login from './pages/Login';
import Register from './pages/Register';
import Main from './pages/Main';
import CreateVote from './pages/CreateVote';
import VotePage from './pages/VotePage';
import 'antd/dist/reset.css';
import './App.css';


//定义了所有的路由路径，使结构清晰，每个页面都有独立的组件，方便维护、管理、扩展
const App: React.FC = () => {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/login" element={<Login />} />
        <Route path="/register" element={<Register />} />
        <Route path="/main" element={<Main />} />
        <Route path="/create-vote" element={<CreateVote />} />
        <Route path="/vote/:voteId" element={<VotePage />} />
      </Routes>
    </Router>
  );
};

export default App;
